package com.cooper.moviedb.bo;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 * User: cooperlee
 * Date: 11/19/12
 * Time: 12:29 PM
 */
public class ReleaseChangeEntityPK implements Serializable {
    private int id;

    @Id
    @Column(name = "ID", nullable = false, insertable = true, updatable = true, length = 10, precision = 0)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    private int page;

    @Id
    @Column(name = "PAGE", nullable = false, insertable = true, updatable = true, length = 10, precision = 0)
    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ReleaseChangeEntityPK that = (ReleaseChangeEntityPK) o;

        if (id != that.id) return false;
        if (page != that.page) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + page;
        return result;
    }
}
